// <!-- 项目：项目 -->

import ByIcon from "@/components/ui/ByIcon";
import { Text, View } from "@tarojs/components";
import { cva } from "class-variance-authority";

const types = [
  { type: "warning", label: "资源" },
  { type: "error", label: "意愿" },
  { type: "primary", label: "设计" },
  { type: "success", label: "完工" },
];

const cvaDot = cva(
  "relative flex-center w-[90px] h-[90px] -ml-2.5 rounded-full bg-primary text-white z-10",
  {
    variants: {
      type: {
        error: "bg-error",
        primary: "bg-primary",
        success: "bg-success",
        warning: "bg-warning",
      },
    },
  }
);

type CardProjectProps = {
  source: any;
};

export default ({ source }: CardProjectProps) => {
  return (
    <View className="mt-3 flex items-center ml-3">
      <View className={cvaDot({ type: source["type"] })}>
        {source["label"]}
      </View>

      <View className="rounded-md bg-white flex-auto py-3 pl-9 pr-3 -ml-6">
        <View className="text-lg font-bold">项目</View>
        <View className="my-2 text-sm text-second">
          深圳市福田区皇御苑A-12-1219
        </View>

        <View className="flex items-center">
          <View className="flex-auto">
            <Text className="text-primary text-lg font-bold">SS9013</Text>
            <Text className="px-1 text-third">/</Text>
            <Text>30天前</Text>
          </View>

          <ByIcon name="Phone" size={40} className="text-primary" />
        </View>
      </View>
    </View>
  );
};
